import React, { Component } from "react";
import PropTypes from "prop-types";
import { Form, Input } from "antd";
class Addform extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }
  static propTypes = {
    setForm: PropTypes.func.isRequired,
  };
  componentWillMount() {
    this.props.setForm(this.props.form);
  }
  render() {
    const { getFieldDecorator } = this.props.form;

    return (
      <Form>
        <Form.Item label="角色名称">
          {getFieldDecorator("roleName", {
            initialValue: "", //初始化
            rules: [
              {
                required: true,
                message: "角色名称必须",
              },
            ],
          })(<Input placeholder="请输入角色名称" />)}
        </Form.Item>
      </Form>
    );
  }
}

export default Form.create()(Addform);
